//
//  ThreeTableViewCell.m
//  Food
//
//  Created by 15 on 15/7/18.
//  Copyright (c) 2015年 李志远. All rights reserved.
//

#import "ThreeTableViewCell.h"
#import "BaseHeader.h"
#import "UIImageView+WebCache.h"
@implementation ThreeTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.lblBrowse = [[[UILabel alloc] init] autorelease];
        [self.contentView addSubview:self.lblBrowse];
        self.lblInstruction = [[[UILabel alloc] init] autorelease];
        [self.contentView addSubview:self.lblInstruction];
        self.viewFood = [[[UIImageView alloc] init] autorelease];
        [self.contentView addSubview:self.viewFood];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.viewFood.frame = CGRectMake(0, 0, SCREEN_WIDTH, 200);
    self.lblInstruction.frame = CGRectMake(10, 205, 200, 20);
    self.lblBrowse.frame = CGRectMake(220, self.lblInstruction.frame.origin.y, 90, 20);

}

- (void)setModel:(HealthKonw *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    [self.viewFood setImageWithURL:[NSURL URLWithString:self.model.img] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.lblInstruction.text = self.model.title;
    self.lblInstruction.textAlignment = NSTextAlignmentLeft;
    self.lblBrowse.text = [NSString stringWithFormat:@"%@浏览", self.model.allClick];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
